Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add solution #2630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add solution #2630

wants to merge 1 commit into from

Conversation

10hokageee
Copy link

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on your pull request! There are a few minor issues related to code style and readability, but they don't significantly impact the functionality of the code. Remember to always format your ternary operators correctly and use destructuring for getting access to values of props object. Keep going! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -1 +1,14 @@
// export const Person = ({ person }) => ();
export const Person = ({ person }) => {
const { name, age, partnerName, sex, isMarried } = person;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. [CODE STYLE] - Use destructuring for getting access to values of props object. Currently, you are destructuring the person object within the component function. Instead, you can destructure the person properties directly in the function parameters. This will make the code cleaner and more readable. Here is how you can do it:
    jsx
    export const Person = ({
    name,
    age,
    partnerName,
    sex,
    isMarried
    }) => {...}

<h2 className="Person__name">{`My name is ${name}`}</h2>
{age && <p className="Person__age">{`I am ${age}`}</p>}
<p className="Person__partner">
{isMarried ? `${partnerName} is my ${partner}` : 'I am not married'}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. [CODE STYLE] - Format ternary operator operands correctly - move each operand to the separate line. This will improve the readability of your code. Here is the improved version:
{isMarried 
  ? `${partnerName} is my ${partner}` 
  : 'I am not married'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants